/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

#root {
  height: 100%;
}

/* 仓库管理仪表盘样式 */
.warehouse-dashboard {
  padding: 20px;
  background-color: #f9fafb;
  height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

/* 统计卡片样式 */
.stat-cards {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-shrink: 0;
}

.stat-card {
  padding: 16px;
  flex: 1;
  transition: transform 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
}

.card-title {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}

.card-value {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 8px;
  color: #1d2939;
}

.unit {
  font-size: 14px;
  color: #666;
  margin-left: 4px;
}

.card-trend {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.up {
  color: #00b42a;
}

.down {
  color: #f53f3f;
}

.trend-desc {
  color: #9ca3af;
  font-size: 12px;
}

/* 图表区域样式 */
.charts-grid {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap; /* 允许换行 */
  flex-shrink: 0;
}

.chart-panel {
  padding: 16px;
  flex: 1;
  min-width: 400px; /* 设置最小宽度 */
  max-width: calc(50% - 10px); /* 最大宽度为一半减去间距 */
  position: relative;
  min-height: 300px; /* 设置最小高度，让图表有足够空间 */
}

.chart-title {
  font-size: 16px;
  margin-bottom: 16px;
  color: #1d2939;
  font-weight: 600;
}

/* 记录表格样式 */
.records-section {
  padding: 16px;
  display: flex;
  flex-direction: column;
  margin-top: 20px;
}

.records-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.records-header h3 {
  font-size: 16px;
  color: #1d2939;
  font-weight: 600;
  margin: 0;
}

.header-actions {
  display: flex;
  gap: 12px;
}

.new-order-btn {
  background: #165DFF;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.new-order-btn:hover {
  background: #0E42D2;
}

.export-btn {
  background: transparent;
  border: 1px solid #e0e0e0;
  padding: 8px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: #666;
}

.export-btn:hover {
  border-color: #165DFF;
  color: #165DFF;
  background: rgba(22, 93, 255, 0.05);
}

.table-container {
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  max-height: 500px; /* 设置最大高度，超出时显示滚动条 */
}

.records-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.records-table th,
.records-table td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid #f5f5f5;
}

.records-table th {
  font-weight: 600;
  color: #666;
  font-size: 14px;
}

.records-table td {
  font-size: 14px;
  color: #333;
}

.text-muted {
  color: #999;
}

.status-tag {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.status-completed {
  background: #e6f7ed;
  color: #00b42a;
}

.status-processing {
  background: #f0f7ff;
  color: #165dff;
}

.status-pending {
  background: #fff7e6;
  color: #ff7d00;
}

.action-buttons {
  display: flex;
  gap: 8px;
}

.btn-view,
.btn-print {
  background: transparent;
  border: 1px solid #e5e7eb;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  color: #666;
}

.btn-view:hover,
.btn-print:hover {
  border-color: #165dff;
  color: #165dff;
  background: rgba(22, 93, 255, 0.05);
}

/* 分页样式 */
.pagination-control {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #f5f5f5;
  flex-shrink: 0; /* 防止分页区域被压缩 */
}

.record-count {
  font-size: 14px;
  color: #666;
}

.pagination {
  display: flex;
  gap: 4px;
}

.page-btn {
  background: transparent;
  border: 1px solid #e5e7eb;
  width: 32px;
  height: 32px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #666;
}

.page-btn:hover:not(.active):not(:disabled) {
  border-color: #165dff;
  color: #165dff;
  background: rgba(22, 93, 255, 0.05);
}

.page-btn.active {
  background: #165dff;
  color: white;
  border-color: #165dff;
}

.page-btn:disabled {
  color: #d1d5db;
  cursor: not-allowed;
}

.page-btn.prev, .page-btn.next {
  width: auto;
  padding: 0 12px;
}

/* 响应式调整 */
@media (max-width: 1200px) {
  .chart-panel {
    min-width: 300px;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .warehouse-dashboard {
    padding: 12px;
  }
  
  .stat-cards, .charts-grid {
    flex-direction: column;
    gap: 12px;
  }
  
  .stat-card {
    padding: 12px;
  }
  
  .chart-panel {
    min-width: auto;
    max-width: 100%;
  }
  
  .pagination-control {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .pagination {
    width: 100%;
    justify-content: center;
  }
  
  .records-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }
}